<?php

require_once 'Zend/Db/Table/Abstract.php';

/**
 * Table model 'Tables'
 */
class Default_Model_Tables extends Zend_Db_Table_Abstract
{
    protected $_mapper;
    
    public function setMapper($mapper)
    {
        $this->_mapper = $mapper;
        return $this;
    }

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Default_Model_TablesMapper());
        }
        return $this->_mapper;
    }

    /**
     * Get formated list of tables by data base name for extjs treeNodes
     * @param string $dataBaseName
     * @return array
     */
    public function getAllTablesFromDataBase($dataBaseName)
    {
        // Get list of tables from mapper
        $tables = $this->getMapper()->getAllTablesFromDataBase($dataBaseName);

        return $tables;
    }
}

